In a stage of network evaluation and optimization, an operator needs to perform evaluation and optimization on a network and analyze a network element in the network and a service status. For example, the operator needs to collect configuration information of a network element, collect traffic information of a port, evaluate a capacity of the port, discover a port with overloaded traffic, and perform capacity expansion or adjust a flow path for the port. When an optimization and analysis tool is used to perform the network evaluation and optimization, generating a network topology needs to depend on the optimization and analysis tool. Network traffic evaluation, service evaluation, and emulation can be performed only based on the network topology and a result of network evaluation and analysis is displayed based on the network topology.
A network topology discovery method in the prior art is collecting network characteristic data of a network element in a to-be-analyzed network, obtaining, by means of calculation according to the collected network characteristic data and a corresponding network topology discovery algorithm, a link set corresponding to the algorithm, and further obtaining a network topology. For example, a network topology based on a port Internet Protocol (IP) address characteristic is obtained by means of calculation according to a port IP address and an IP address matching algorithm, or a network topology based on a port alias characteristic is obtained by means of calculation according to a port alias and a port alias matching algorithm, or a network topology of a network established based on Cisco devices (only a network established based on Cisco devices is supported) may be obtained according to the Cisco Discovery Protocol (CDP), or the like.
In the prior art, when network topology discovery is performed based on a single type of network characteristic data, if network topology discovery is performed when a to-be-analyzed network does not support this type of network characteristic or a corresponding algorithm, accuracy of network topology discovery is low; or in a case in which network topology discovery is performed when a to-be-analyzed network supports this type of network characteristic or a corresponding algorithm, because data is not completely collected or data is inconsistent, uncertainty exists in a link relationship in the network, and accuracy of network topology discovery is also relatively low. In addition, when network topology discovery is performed by using multiple types of network characteristic data, no comprehensive analysis for improving accuracy of network topology discovery is performed on multiple obtained network topology discovery results.